<template>
    <p>这是Product界面</p>
</template>
<script>
export default{
    watch:{
        $route(newVal, oldVal){
            console.log('newVal',newVal);
            console.log('oldVal',oldVal);
            this.init()
        }
    },
    methods:{
        init(){
            console.log("初始化数据");
            console.log("现在的id是"+this.$route.params.id);
        }
    },
    mounted(){
        console.log("mounted生命周期函数触发了");
        console.log(this.$route)
    }
}
</script>
<style scoped>
</style>